package com.mayuanfei.springioc.service;

import com.mayuanfei.springioc.domain.SysUser;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * User管理服务类
 *
 * @author 老马
 * @date 2023-02-27 13:58
 */
@Component
public class SysUserManager {
    /**
     * @Autowired 配合 @Qualifier,可以通过名称指定注入的对象
     * @Resource 如果不配置name 那么就是根据类型注入;配置了name就以名称注入
     */
//    @Autowired
//    @Qualifier("sysUserServcieImpl2")


    @Resource(name="sysUserServcieImpl")
    private SysUserService userService;
//    @Resource
//    private SysUserService sysUserServcieImpl2;

    public void addUser(SysUser user) {
        this.userService.addUser(user);
    }
}